	<%
		Dim FileName, FileValue, fso, MyFile
		Const ForReading = 1, ForWriting = 2
		Dim RName, RCategory
		Dim Dates, Director, CheckIn, About, Silent, Offering, PayPal
		Dim Title
		
		Sub GetDetails(RName)
			FileName = Server.MapPath("Text/db.txt")
			Set fso = Server.CreateObject("Scripting.FileSystemObject")
			Set MyFile = fso.OpenTextFile(FileName, ForReading)
				Do While Not MyFile.AtEndOfStream
					FileValue = MyFile.ReadLine
					'Response.Write "<b>FileValue = </b>" & FileValue & "<br>"
					If UCase(Left(FileValue,6))="[NAME]" Then
						If UCase(Right(FileValue, Len(FileValue)-6)) = UCase(RName) Then
							FileValue = MyFile.ReadLine
							Title=Right(FileValue,Len(FileValue)-7)
							
							FileValue = MyFile.ReadLine
							RCategory = Right(FileValue,Len(FileValue)-10)
						
							FileValue = MyFile.ReadLine
							Dates = Split(Right(FileValue, Len(FileValue)-7), "|")
							Dim i, DatePair
							for i = 0 to ubound(Dates)
								DatePair = split(Dates(i), "-")
								If UBound(DatePair) > 0 Then
									If Trim(DatePair(0)) = Trim(DatePair(1)) Then
										Dates(i) = Trim(DatePair(0))
									End If
								End If
							next
							
							FileValue = MyFile.ReadLine
							Director = Split(Right(FileValue, Len(FileValue)-10), "|")
							
							FileValue = MyFile.ReadLine
							CheckIn = Split(Right(FileValue, Len(FileValue)-9), "|")
							
							'Get the about details and combine them into 1 big string
							FileValue = MyFile.ReadLine
							If UCase(FileValue) = "[ABOUT]" Then
								FileValue = MyFile.ReadLine  'Get past the [About] tag
								Do While UCase(FileValue) <> "[/ABOUT]"
									About = About & FileValue
									FileValue = MyFile.ReadLine
								Loop
							End If
							
							FileValue = MyFile.ReadLine
							Offering = Right(FileValue, Len(FileValue)-10)
							If Offering = "0" Then
								Offering = "Please Call"
							Else
								Offering = FormatCurrency(Right(FileValue, Len(FileValue)-10))
							End If
							
							'Get the PayPal button details and combine them into 1 big string
							FileValue = MyFile.ReadLine
							If UCase(FileValue) = "[PAYPAL]" Then
								FileValue = MyFile.ReadLine  'Get past the [PayPal] tag
								Do While UCase(FileValue) <> "[/PAYPAL]"
									PayPal = PayPal & FileValue
									FileValue = MyFile.ReadLine
								Loop
							End If

							
							If TypeName(Dates) = "Variant()" Then Dates = Join(Dates,"<br>")
							'Response.Write TypeName(Director)
							If TypeName(Director) = "Variant()" Then Director = Join(Director, "<br>")
							If TypeName(CheckIn) = "Variant()" Then CheckIn = Join(CheckIn, "<br>")
							Exit Do
						End If
					End If
				Loop
			MyFile.Close
			Set fso = Nothing
		End Sub
	%>
